package com.mapper;

import com.pojo.Fee_lfy;
import com.pojo.Zixunshi_lfy;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;
@Mapper
public interface Fee_lfyMapper {
    @Select("select zixunshi_id,zixunshi_name, fee_type,fee_price,fee_zid from zixunshi_lfy left join fee_lfy on " +
            "zixunshi_id=fee_zid where " +
            "zixunshi_id=#{id}")
    @Results({
            @Result(property = "zixunshiName", column = "zixunshi_neme"),
            @Result(property = "feeLfyList", column = "zixunshi_id", many = @Many(select = "com.mapper" +
                    ".Fee_lfyMapper.selectTypeById",fetchType = FetchType.LAZY))
    })
    List<Zixunshi_lfy> selectType(Integer id);

    @Select("select fee_type,fee_price from fee_lfy where fee_zid=#{id}")
    List<Fee_lfy> selectTypeById(Integer id);
}
